#ifndef STRUCTS_HPP
#define STRUCTS_HPP

#include <iostream>
using namespace std;

// 字符-权重-编码
typedef struct Code
{
  // 代表的字符
  char character;
  // 权重
  int weight;
  // 编码
  string decode;
  // 判断是否被匹配
  bool isMatched;
} Code;

// 节点
typedef struct Node
{
  int data;
  struct Node *left;
  struct Node *right;
} Node;

// 辅助链表-->用于存放点
//  head  ->  node  ->  node  ->  node
typedef struct HelpNode
{
  int data;
  struct HelpNode *next;
} HelpNode;

// 用于存放未合成树节点
typedef struct NoMergeTreeNode
{
  Node *noMergeTree;
  struct NoMergeTreeNode *next;
} NoMergeTreeNode;

// 未合成树链表头
// head -> node -> node
typedef struct NoMergeTreeList
{
  int length;
  NoMergeTreeNode *next;
} NoMergeTreeList;

// 用于存放匹配未合成树返回的结果
typedef struct Result
{
  int count;
  Node *firstTree;
  Node *secondTree;
} Result;

#endif
